<?php
// src/Asiah/SiklusBundle/Entity/Link.php
namespace Asiah\SiklusBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity(repositoryClass="Asiah\SiklusBundle\Repository\LinkRepository")
 * @ORM\Table(name="link")
 */

class Link {
	
	public function __construct() {
		$this->setView(0);
		$this->setLastAccessed(new \DateTime());
	}

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	protected $id;
	/**
	 * @ORM\Column(type="string", length=6, unique=true)
	 */
	protected $short_link;
	/**
	 * @ORM\Column(type="string", unique=true)
	 */
	protected $real_link;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $view;
	/**
	 * @ORM\Column(type="date", nullable=true)
	 */
	protected $last_accessed;
	/**
	 * @ORM\Column(type="integer")
	 */
	protected $position;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set short_link
     *
     * @param string $shortLink
     */
    public function setShortLink($shortLink)
    {
        $this->short_link = $shortLink;
    }

    /**
     * Get short_link
     *
     * @return string 
     */
    public function getShortLink()
    {
        return $this->short_link;
    }

    /**
     * Set real_link
     *
     * @param string $realLink
     */
    public function setRealLink($realLink)
    {
        $this->real_link = $realLink;
    }

    /**
     * Get real_link
     *
     * @return string 
     */
    public function getRealLink()
    {
        return $this->real_link;
    }

    /**
     * Set view
     *
     * @param integer $view
     */
    public function setView($view)
    {
        $this->view = $view;
    }

    /**
     * Get view
     *
     * @return integer 
     */
    public function getView()
    {
        return $this->view;
    }

    /**
     * Set last_accessed
     *
     * @param date $lastAccessed
     */
    public function setLastAccessed($lastAccessed)
    {
        $this->last_accessed = $lastAccessed;
    }

    /**
     * Get last_accessed
     *
     * @return date 
     */
    public function getLastAccessed()
    {
        return $this->last_accessed;
    }

    /**
     * Set position
     *
     * @param integer $position
     */
    public function setPosition($position)
    {
        $this->position = $position;
    }

    /**
     * Get position
     *
     * @return integer 
     */
    public function getPosition()
    {
        return $this->position;
    }

}